﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace GuiMenyTest
{
    public partial class Läs : Form
    {
        private IntegerData _id; 
        public Läs()
        {
            InitializeComponent();
        }
        public Läs(IntegerData id)
        {
            _id = id;
            InitializeComponent();
        }

      //*
        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }
        //*/
        private void buttonOkej_Click(object sender, EventArgs e)
        {
           // this._id.Data = System.Convert.ToInt32(this.textBox1.Text);
            int tester;
            if (!Int32.TryParse(this.textBox1.Text.ToString(), out tester))
                MessageBox.Show("Kan inte läsa in [" + textBox1.Text + "]");
            this._id.Data = tester;
            this.Close();
        }

        private void buttonAvbryt_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
